<?php

namespace Database\Factories;

use App\Models\StoreCouponUser;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

class StoreCouponUserFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = StoreCouponUser::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'cid' => $this->faker->numberBetween(1, 20),
            'user_id' => $this->faker->randomElement(User::pluck('id')),
            'coupon_title' => $this->faker->text(5),
            'coupon_price' => $this->faker->numberBetween(1, 100),
            'use_min_price' => $this->faker->randomFloat(2, 0, 10),
            'add_time' => $this->faker->time('Y-m-d H:i:s'),
            'end_time' => $this->faker->time('Y-m-d H:i:s'),
            'use_time' => $this->faker->time('Y-m-d H:i:s'),
            'type' => $this->faker->randomElement([0, 1]),
            'status' => $this->faker->randomElement(['status_one', 'status_two', 'status_three']),
            'is_fail' => $this->faker->randomElement([0, 1]),
        ];
    }
}
